<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>

		<js href="__PUB__/ueditor/ueditor.config.js" />
		<js href="__PUB__/ueditor/ueditor.all.min.js" />
		
		<script>
		    $(function(){
		        var ue = UE.getEditor('Editcontainer',{
		            serverUrl :'{:U('Manager/Article/ueditor')}'
		        });

		    })
		</script>

	</head>
	
	<body>	
	<h6><kbd>&nbsp;不爽就写几篇文章吧&nbsp;</kbd></h6>
		<ul class="nav nav-tabs navbar-default ">
					<li class="active"><a href="#jc" data-toggle="tab">基础</a></li>
					<li><a href="#qt" data-toggle="tab">其他</a></li>
				</ul>
				<form class="has-success alert alert-info" method="post" enctype="multipart/form-data"   action="{:u(MODULE_NAME.'/Article/createHandle')}">
				<input type="hidden" name="id" value="{$blog.id}">
		
				<div class="tab-content">
						<div class="tab-pane fade in active" id="jc">
								<label for="txt_title">标题</label>
								<input id="txt_title" value="{$blog.title}" required name="title" type="text" class="form-control" placeholder="请输入文章的标题" />
								<label for="Editcontainer">内容</label>
								<div class="thumbnail">
									  <script id="Editcontainer" name="content" type="text/plain">
				     					 {$blog.content|default=""}
				    					</script>
								</div>
								<label for="txt_description">描述</label>
								<textarea id="txt_description"   name="description" class="form-control" rows="" placeholder="请输入文章描述或者简介" cols="">
									{$blog.description}
								</textarea>
						</div>
					<div class="tab-pane fade" id="qt">
							<div class="form-group">
								<label for="type">内容类型</label>
								<select name="type" name="type" id="type" class="form-control select-inverse-dropdown" id="">
									<option value="word">文章</option>
									<option value="music">音乐</option>
									<option value="video">视频</option>
									<option value="image">图片</option>
								</select>
							</div>
						<div class="form-group">
								<label>公开度</label>
								<select name="state" name="state" class="form-control select-inverse-dropdown" id="">
									<option value="public">所有人可访问</option>
									<option value="password">输入密码访问</option>
									<option value="save">草稿箱</option>
									<option value="remove">回收站</option>
								</select>
						</div>
		        <div class="form-group">
								<label for="sortId">选择分类</label>
								<select name="sort_id" id="sortId" class="form-control select-inverse-dropdown" >
										<option value="0">未分类</option>
										<foreach name="sorts" item="sort">
									 			<option value="{$sort.id}">{$sort.name}</option>
									 	</foreach>
								</select>
						</div>
						<div class="form-group">
								<label for="txt_password">访问密码（当公开度设置成输入密码访问有效）</label>
								<input id="txt_password" value="{$blog.password}" name="password" type="text" class="form-control" placeholder="访问该内容的密码" />
						</div>
								<div class="form-group">
								<label for="number">优先级（优先级越高越靠前）</label>
								<input id="number" value="{$blog.number}"  name="number" type="number" value="1" class="form-control" placeholder="优先级/排序" />
						</div>		
					<div class="form-group">
		          <label class="control-label" for="formGroupInputSmall">是否推荐</label>
		          <eq name="blog['istop']" value="n">
					<input type="checkbox" name="istop" data-on-text="是"  value="y"  data-off-text="否"  data-toggle="switch" data-on-color="success" data-off-color="warning" />
					<else />
					<input type="checkbox" name="istop" data-on-text="否"  value="n" data-off-text="是"  data-toggle="switch" data-on-color="warning" data-off-color="success" />
				</eq>

		        		</div>	
		        	<div class="form-group">
		          <label class="control-label" for="formGroupInputSmall">允许评论</label>
		          
		           <eq name="blog['iscomment']" value="n">a
					<input type="checkbox" name="iscomment" data-on-text="是"  value="y"  data-off-text="否"  data-toggle="switch" data-on-color="success" data-off-color="warning" />
					<else />
					<input type="checkbox" name="iscomment" data-on-text="否"  value="n" data-off-text="是"  data-toggle="switch" data-on-color="warning" data-off-color="success" />
				</eq>

		        		</div>	
		        			<div class="form-group">
		        				<a class="btn btn-success">上传封面图片</a>
		        			<input name="file" type="file" id="file" class="transFile" />
		        			<img style="height:150px;width:200px" src="__IMGS__/article_images/{$blog.image}" class="thumbnail pull-right viewFengMian" />
		        			
		        			</div>	<br />
						<div class="form-group">
								<label for="">标题前缀</label>
								<input type="text" value="{$blog.titlehead}"  name="titlehead" class="form-control" placeholder="显示在标题前面的前缀标签" />
						</div>
						
						<div class="form-group">
								<label for="readCount">浏览量</label>
								<input value="{$blog.readcount}" type="number"  name="readcount" class="form-control" placeholder="该内容的访问量" />
						</div>
						 <div class="form-group">
			               <label for="">创建时间</label>
			                <div class="input-group date form_datetime col-md-5" data-date="{$blog['date']==null?time():$blog['date']|date='Y-m-d H:s',###}" data-date-format="dd MM yyyy - HH:ii p" data-link-field="dtp_input1">
			                    <input value="{$blog['date']==null?time():$blog['date']|date='Y-m-d H:s',###}" name="date" class="form-control" size="16" type="text" value="" readonly>
								<span class="input-group-addon"><span class="glyphicon glyphicon-th"></span></span>
			                </div>
            			</div>
            			</div>
									<p></p>
								<input type="submit" class="btn btn-danger" value="确 定"  />
								<input type="submit" formaction="{:u(MODULE_NAME.'/Article/index')}" class="btn btn-info"  value="返 回"  />
								<input type="submit" class="btn btn-warning"  value="保存草稿箱"  />
							
			</form>
			

	</body>		
	 <link rel="stylesheet" type="text/css" href="__PUBLIC__/Date/css/bootstrap-datetimepicker.min.css"/>
	 <script src="__PUBLIC__/Date/js/bootstrap-datetimepicker.min.js"></script>
  		<script>
  		$('[name=state]').val('{$blog.state|default="public"}');
  		$('[name=sort_id]').val('{$blog.sort_id|default="0"}');
  		$('[name=type]').val('{$blog.type|default="word"}');
  		
  		//时间
    $('.form_datetime').datetimepicker({
        //language:  'fr',
        weekStart: 1,
        todayBtn:  1,
		autoclose: 1,
		todayHighlight: 1,
		startView: 2,
		forceParse: 0,
        showMeridian: 1,
           format: "yyyy-mm-dd hh:ii"
    });
    //上传图片显示图片
    $("#file").change(function(e)
    {
    	var files=this.files;
    	var read=new FileReader();
				read.readAsDataURL(files[0]);
				read.onloadend=function()
				{
					$('.viewFengMian').attr("src",this.result);
				}
    })
    

</script>

</html>
